@import './ddfont.less';

.flexAbsoluteCenter() {
  display: flex;
  justify-content: center;
  align-items: center;
}
.steps {
  @primary-color: #1890ff;
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: section;
  .step {
    .flexAbsoluteCenter();
    flex-direction: column;
    flex: 1;
    position: relative;
    pointer-events: none;
    cursor: pointer;
    pointer-events: all;

    &:not(:last-child) {
      &:before,
      &:after {
        display: block;
        position: absolute;
        top: 50%;
        left: 50%;
        height: 1px;
        content: '';
        transform: translateY(-50%);
        will-change: width;
        // z-index: -1;
      }
    }

    &:before {
      width: 100%;
      background-color: @primary-color;
    }

    &:after {
      width: 0;
      background-color: @primary-color;
    }

    // 完成步骤
    &--complete {
      .step__icon {
        background: linear-gradient(312deg, #45dbff 0%, #1890ff 100%);
        box-shadow: 0px 1px 4px 0px rgba(26, 93, 173, 0.24);
        border: 1px solid #ffffff;
        font-family: 'ddfont';
        &:before {
          display: block;
          color: #fff;
          content: '\e613';
          font-size: 14px;
        }
      }
      .step__label {
        color: @primary-color;
      }
    }

    // 当前步骤
    &--active {
      .step__icon {
        background: linear-gradient(312deg, #45dbff 0%, #1890ff 100%);
        box-shadow: 0px 1px 4px 0px rgba(26, 93, 173, 0.24);
        border: 1px solid #ffffff;
        &:before {
          color: #fff;
        }
      }
    }
  }

  .step__icon {
    .flexAbsoluteCenter();
    position: relative;
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid @primary-color;
    border-radius: 50%;
    color: transparent;
    font-size: 14px;

    &:before {
      counter-increment: section;
      display: block;
      color: @primary-color;
      content: counter(section);
      font-size: 24px;
    }
  }

  .step__label {
    position: absolute;
    bottom: -28px;
    left: 50%;
    margin-top: 12px;
    font-size: 14px;
    text-transform: uppercase;
    transform: translateX(-50%);
    word-break: keep-all;
    color: #666;
  }
}
